<style>
    .layui-form.layui-card > .layui-card-body {
        padding: 20px 40px !important;
    }
    .think-radio input[type=radio]{
        display: none !important;
    }
</style>
<form onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" class='layui-form layui-card' autocomplete="off">

    <div class="layui-card-body">
        <div class="layui-row margin-bottom-15">
            <label class="layui-col-xs2 think-form-label">属性分类</label>
            <label class="layui-col-xs10">
                <select class="layui-select" required name="attr_id" lay-search>
                    {foreach $cates as $cate}
                    <option {if (isset($vo.attr_id) and $vo.attr_id eq $cate.id) || (isset($attr_id) and $attr_id eq $cate.id)} selected{/if} value="{$cate.id}">{$cate.attr_name|default=''}</option>
                    {/foreach}
                </select>
            </label>
        </div>

        <div class="layui-row margin-bottom-15">
            <label class="layui-col-xs2 think-form-label">商品属性名称</label>
            <label class="layui-col-xs10">
                <input name="attr_value_name" required value='{$vo.attr_value_name|default=""}' placeholder="请输入商品属性名称" class="layui-input">
            </label>
        </div>

        <div class="layui-row margin-bottom-15">
            <label class="layui-col-xs2 think-form-label">属性类型</label>
            <div class="layui-col-xs10">
                <div>
                    <input type="radio" name="attr_value_type" value="0" title="单选" {if isset($vo.attr_value_type) and $vo.attr_value_type eq 0}checked{/if}>&nbsp;&nbsp;&nbsp;&nbsp;
                    <input type="radio" name="attr_value_type" value="1" title="唯一" {if isset($vo.attr_value_type) and $vo.attr_value_type eq 1}checked{/if}>
                </div>
            </div>
        </div>


    </div>

    <div class="hr-line-dashed"></div>
    <div class="layui-form-item text-center">
        {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
        <button class="layui-btn" type='submit'>保存数据</button>
        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
    </div>
</form>
<script>window.form.render();</script>

